<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<!--suppress HtmlRequiredTitleElement -->
<head>
    <th:block th:include="include :: header('字典数据表')"/>
</head>
<body class="layui-layout-body theme-himio layui-anim layui-anim-upbit">
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <!-- 表格工具栏 -->
            <form class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">字典标签:</label>
                        <div class="layui-input-inline">
                            <input name="dictLabel" class="layui-input" placeholder="请输入字典标签"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">字典键值:</label>
                        <div class="layui-input-inline">
                            <input name="dictValue" class="layui-input" placeholder="请输入字典键值"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">状态:</label>
                        <div class="layui-input-inline">
                            <input name="status" class="layui-input" placeholder="请输入状态"/>
                        </div>
                    </div>
                    <div class="layui-inline">&emsp;
                        <button class="layui-btn icon-btn" lay-filter="dictDataTbSearch" lay-submit>
                            <i class="layui-icon layui-icon-search"></i>搜索
                        </button>
                    </div>
                </div>
            </form>
            <!-- 数据表格 -->
            <table id="dictDataTable" lay-filter="dictDataTable"></table>
        </div>
    </div>
</div>

<!--表格操作工具按钮-->
<script type="text/html" id="dictDataTbBar">
    <a class="layui-btn layui-bg-blue layui-btn-sm icon-btn" lay-event="edit" shiro:hasPermission="system:dict:edit"><i
            class="fa fa-edit"></i>修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-sm icon-btn" lay-event="del"
       shiro:hasPermission="system:dict:remove"><i class="fa fa-trash"></i>删除</a>
</script>

<!-- 表单弹窗 edit -->
<script type="text/html" id="dictDataEditDialog">
    <form id="dictDataEditForm" lay-filter="dictDataEditForm" class="layui-form model-form">
        <input name="dictCode" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">字典排序:</label>
            <div class="layui-input-block">
                <input name="dictSort" placeholder="请输入字典排序" class="layui-input" lay-verType="tips" type="number"
                       style="width: 200px"
                       lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">字典标签:</label>
            <div class="layui-input-block">
                <input name="dictLabel" placeholder="请输入字典标签" class="layui-input" lay-verType="tips"
                       lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">字典键值:</label>
            <div class="layui-input-block">
                <input name="dictValue" placeholder="请输入字典键值" class="layui-input" lay-verType="tips"
                       lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">字典类型:</label>
            <div class="layui-input-block">
                <input name="dictType" placeholder="请输入字典类型" class="layui-input" lay-verType="tips" readonly
                       lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">样式属性:</label>
            <div class="layui-input-block">
                <input name="cssClass" placeholder="请输入样式属性" class="layui-input" lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">表格回显样式:</label>
            <div class="layui-input-block">
                <input name="listClass" placeholder="请输入表格回显样式" class="layui-input" lay-verType="tips"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">是否默认:</label>
            <div class="layui-input-block">
                <input type="radio" th:each="dict : ${@dict.getType('sys_yes_no')}" th:id="${dict.dictCode}"
                       name="isDefault" th:value="${dict.dictValue}" th:title="${dict.dictLabel}"
                       lay-verify="required" required lay-verType="tips"
                       th:checked="${dict.default}"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">状态:</label>
            <div class="layui-input-block">
                <input type="radio" th:each="dict : ${@dict.getType('sys_normal_disable')}" th:id="${dict.dictCode}"
                       name="status" th:value="${dict.dictValue}" th:title="${dict.dictLabel}"
                       lay-verify="required" required lay-verType="tips"
                       th:checked="${dict.default}"/>
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn" lay-filter="dictDataEditSubmit" lay-submit>保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </form>
</script>


<!-- js部分 -->
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var addFlag = [[${@permission.hasPermit('system:dict:add')}]];
    var editFlag = [[${@permission.hasPermit('system:dict:edit')}]];
    var removeFlag = [[${@permission.hasPermit('system:dict:remove')}]];
    var exportFlag = [[${@permission.hasPermit('system:dict:export')}]];
    var dictSysNormalDisable = [[${@dict.getType('sys_normal_disable')}]]
    var prefix = ctx + "system/dict";
    var dictType = [[${dictType}]]
</script>
<script th:src="@{/static/assets/system/js/dictData.js}"></script>
</body>
</html>

